package io;

public class EncodingApp {

	public static void main(String[] args) throws Exception{
		
		System.out.print("本地操作系统默认字符编码：");
		System.out.println(System.getProperty("file.encoding"));
		
		// 在内存中，采用的是Unicode编码
		char c = '好';
		byte lowBit = (byte)(c & 0x00FF);
		byte hightBit = (byte)((c & 0xFF00) >> 8);
		System.out.println(hightBit+" "+lowBit);
		// System.out.println(Integer.toBinaryString(lowBit));
		// System.out.println(Integer.toHexString('好'));

		// 本地操作系统的默认编码
		App.printArray("好".getBytes());
		// Unicode
		App.printArray("好".getBytes("Unicode"));
		// UTF-8
		App.printArray("好".getBytes("UTF-8"));

	}
}